package com.yuandian.customer.perception.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuandian.api.customer_perception.po.BusinessComplianceStatisticsParms;
import com.yuandian.api.customer_perception.po.StepDetailParams;
import com.yuandian.api.customer_perception.vo.BusinessComplianceStatisticsVo;
import com.yuandian.api.customer_perception.vo.ComOperatorOverviewVO;
import com.yuandian.api.customer_perception.vo.OneOperatorStatisticVO;
import com.yuandian.api.customer_perception.vo.StepDetailVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 说明：业务合规统计 Dao层
 * @author LinShiHe
 * @since 2021-05-18
 */
@Repository
public interface BusinessComplianceStatisticsMapper {

    /**
     * 业务合规统计-分页查询操作员总览列表
     */
    List<ComOperatorOverviewVO> queryOperatorOverview(Page<ComOperatorOverviewVO> page,
													  @Param("params") BusinessComplianceStatisticsParms params);

    /**
     * 业务合规统计-查询不合规业务操作不完整类型操作员人数
     * @param params
     * @return
     */
    List<Map<Integer,Integer>> queryOperatorNumber(@Param("params")BusinessComplianceStatisticsParms params);

    /**
     * 根据搜索条件查询各种不合规类型的数据量
     * @param parms 查询参数（工号、营业员姓名、业务编码、业务不合规类型、统计时间等）
     * @return 业务合规列表
     */
    List<ComOperatorOverviewVO> selectEchartDataByUnComplianceType(@Param("parms") BusinessComplianceStatisticsParms parms);

    /**
     *业务合规统计不合规业务详情-查询营业员标识和姓名
     * @return 返回营业信息
     */
    Map<String, Object> selectOperatorInfo(@Param("params") Map<String, Object> map);

    /**
     *业务合规统计不合规业务-查询营业员标识和姓名
     * @return 返回营业信息
     */
    List<Map<String, String>> selectOperatorsInfo(@Param("params") Map<String, Object> map);

    /**
     * 业务合规统计不合规业务详情-查询出该业务中允许失败或不允许失败的步骤列表
     * @param businessCode  业务编码
     * @param isAllowFail 是否允许失败 0：否  1：是
     * @return 结果列表
     */
    List<String> selectProcessByBusicessCode(@Param("businessCode") String businessCode, @Param("isAllowFail") Integer isAllowFail);

	/**
	 * 业务合规统计-查询数据是否数据是否属于‘操作频率过高’
	 */
    List<ComOperatorOverviewVO> selectBusinessCompliances(@Param("parms") BusinessComplianceStatisticsParms parms,
                                                       @Param("temp") BusinessComplianceStatisticsVo temp);

    /**
     * 查询不合规操作员人数
     */
    List<Map<String, Object>> queryUnComplianceOperatorNumber(@Param("params") BusinessComplianceStatisticsParms params);

    /**
     * 分页查询XX(工号)操作员(姓名)不合规业务总览列表
     */
    List<OneOperatorStatisticVO> queryOneOperatorStatistic(@Param("params") BusinessComplianceStatisticsParms params);

    /**
     * 查询实际区域名称
     */
    List<Map<String,String>> queryAllHall();

    /**
     * 查询设定区域名称
     */
    List<String> queryAttributionPlace(@Param("param") String operatorId);

	/**
	 * 分页查询XX(工号)操作员(姓名)不合规业务列表
	 */
	List<BusinessComplianceStatisticsVo> queryViolationBusinessList(Page<BusinessComplianceStatisticsVo> page,
																	@Param("params") BusinessComplianceStatisticsParms params);

	/**
	 * 查询不合规步骤明细列表
	 * @param page
	 * @param params
	 * @return
	 */
	List<StepDetailVo> queryStepDetailList(@Param("page") Page<StepDetailVo> page, @Param("params") StepDetailParams params);
}
